home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-02 | 5.3 KB | 209 lines | [TEXT/MPS ] |
- /*
- File: CyberItem.idl
-
- Contains: xxx put contents here xxx
-
- Written by: the cyberdogs
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 5/29/96 mc More embedding work
- <21> 5/21/96 mc Plug-in support
-
- To Do:
- */
-
- #ifndef __CYBERITEM__
- #define __CYBERITEM__
-
- #include "RefCtObj.idl"
- #include "CyberMisc.idl"
-
- /*==============================================================================
- // Classes defined in this interface
- //=============================================================================*/
-
- interface CyberItem;
-
-
- /*==============================================================================
- // Classes used by this interface
- //=============================================================================*/
-
- interface ODDraft;
- interface ODFrame;
- interface ODPart;
- interface ODSession;
- interface ODStorageUnit;
- interface ODWindow;
-
- interface CyberStream;
- interface CyberSession;
- interface ParameterSet;
-
- /*==============================================================================
- // Types
- //=============================================================================*/
-
-
- #pragma somemittypes off
- typedef somToken CyberResolveCompletionUPP;
-
- #pragma somemittypes on
-
- typedef sequence<CyberItem> CyberItemList;
- typedef ODOSType CDStringProperty;
-
- enum CDCompareType {
- kCDCompareLessThan,
- kCDCompareEqual,
- kCDCompareGreaterThan
- };
-
- enum CDItemInfoType {
- kCDInfoDownload,
- kCDInfoReference,
- kCDInfoPart
- };
-
-
- /*==============================================================================
- // Constants
- //=============================================================================*/
-
- // String Properties
- const CDStringProperty kCDDefaultName = 0;
- const CDStringProperty kCDHomeName = 'HOME';
- const CDStringProperty kCDWindowName = 'WIND';
- const CDStringProperty kCDLogName = 'LOG1';
- const CDStringProperty kCDLog2ndCol = 'LOG2';
- const CDStringProperty kCDNotebookName = 'NBK1';
- const CDStringProperty kCDNotebook2ndCol = 'NBK2';
- const CDStringProperty kCDFileName = 'FILE';
-
- // Parameter Key Names for CyberItem.Open()
- const string kCDParentItemKey = "Apple:ParentItem";
- const string kCDInitialOpenerPartKey = "Apple:InitialOpenerPart";
- const string kCDObtainedOpenerPartKey = "Apple:ObtainedOpenerPart";
- const string kCDSearch4ExistingWindowKey = "Apple:Search4ExistingWindow";
- const string kCDRefreshKey = "Apple:Refresh";
- const string kCDWidthKey = "Apple:Width";
- const string kCDHeightKey = "Apple:Height";
- const string kCDFrameSizeFixed = "Apple:FrameSizeFixed";
- const string kCDWaitForFrame = "Apple:WaitForFrame";
-
- // Bit numbers for CyberItem flags
- const long kCDFlagDontLog = 0;
- const long kCDFlagDontEmbed = 1;
-
- // Bit Masks for CyberItem flags
- const long kCDFlagDontLogMask = 0x00000001;
- const long kCDFlagDontEmbedMask = 0x00000002;
-
-
- /*==============================================================================
- // CyberItem
- //=============================================================================*/
-
- interface CyberItem : ODRefCntObject
- {
- void ICyberItem();
- void Open(in ParameterSet theParams);
- void ShowInfoPart();
-
- void SetUpFromURL(in char* url, in StringPtr defaultName, in ScriptCode defaultNameScript);
-
- // For dragging, etc.
- void ExternalizeContent(in ODStorageUnit su);
-
- // Subclasses must override
- long GetFlatSize();
- long Flatten(in Ptr buffer, in long length); // returns amount written
- long Unflatten(in Ptr buffer); // returns amount read
-
- // Implemented by base class -- Don't override
- void StreamToStorageUnit(in ODStorageUnit su);
-
- CyberItem Clone();
-
- CDCompareType Compare(in CyberItem compare); // base class compares Classes
-
- void GetStringProperty(in CDStringProperty property, in StringPtr theString, out ScriptCode script);
- void SetDefaultName(in StringPtr defaultName, in ScriptCode script);
-
- char* GetURL();
-
- Handle GetIconSuite(in CDItemInfoType infoType);
-
- CyberStream CreateCyberStream();
-
-
- // Base class returns kODTrue
- ODBoolean IsResolved();
- // Base class calls callback immediately
- void Resolve(in CyberResolveCompletionUPP completionProc, in void* userData, in ODPart progressPart);
-
- ODBoolean IsDownloadable();
- ODTypeToken GetContentKind();
- void GetFileInfo(in CDItemInfoType infoType, out ODOSType flCreator, out ODOSType flType);
-
- // Base class returns kODFalse
- ODBoolean IsSecure();
- void ShowSecurityInfo();
-
- // Base class returns 0
- long GetFlags();
-
- // Must be resolved. Base class returns kODNULL
- ODPart CreatePart(in ODDraft draft);
-
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = CyberItem__;
-
- override:
- somInit,
- somUninit,
- Release;
-
- releaseorder:
- ICyberItem,
- Open,
- Release,
- SetUpFromURL,
- GetFlatSize,
- Flatten,
- Unflatten,
- ExternalizeContent,
- StreamToStorageUnit,
- Clone,
- Compare,
- GetStringProperty,
- SetDefaultName,
- GetURL,
- GetIconSuite,
- CreateCyberStream,
- ShowInfoPart,
- IsResolved,
- Resolve,
- IsDownloadable,
- GetContentKind,
- GetFileInfo,
- IsSecure,
- ShowSecurityInfo,
- GetFlags,
- CreatePart;
-
- passthru C_xh = ""
- "#include \"CyberdogProcPtrs.h\""
- "";
- };
- #endif
- };
-
- #endif //__CYBERITEM__
-